package com.xncoding.netty.coder.tcp;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

public class ByteEncoder extends MessageToByteEncoder<Object> {
    @Override
    protected void encode(ChannelHandlerContext ctx, Object user, ByteBuf out) throws Exception {

        out.writeBytes(user.toString().getBytes());
    }
}
